<template>
	<view class="body">
		<cmd-nav-bar :back="true" :title="title" font-color="#fff" background-color="#12B9A3"></cmd-nav-bar>
		<view class="topbox">
			<image class="img" src="../static/other/success.png" mode=""></image>
			<view class="topTitle">恭喜你！已完成全部试题</view>
		</view>
		
		<view class="scoreInfo">
			
			<view class="mitem">
				<text>总分数</text>
				<text>{{examFinishInfo.examScore}}</text>
			</view>
			<u-line color="#E4E4E4" ></u-line> 
			
			<view class="mitem">
				<text>总用时</text>
				<text>{{examFinishInfo.examTime}}</text>
			</view>
			<u-line color="#E4E4E4" ></u-line> 
			
			<view class="mitem">
				<text>答对率</text>
				<text>{{examFinishInfo.counterRate}}</text>
			</view>
			<u-line color="#E4E4E4" ></u-line> 
			
			<view class="mitem">
				<text>答对数</text>
				<text>{{examFinishInfo.counterNum}}</text>
			</view>
			<u-line color="#E4E4E4" ></u-line> 
			
		</view>
	</view>
</template>

<script>
	import cmdNavBar from '@/components/cmd-nav-bar/cmd-nav-bar.vue';
	import * as practiceApi from '@/common/apis/practicetest-api.js';
	export default {
		components: {
			cmdNavBar
		},
		data() {
			return {
				title: '',
				examFinishInfo : {},
				examId : ''
			}
		},
		onLoad(op) {
			this.examId = op.id;
			this.title = op.examName + '试题';
			this.getExamFinishInfo();
		},
		methods: {
			getExamFinishInfo() {
				practiceApi.examFinishView({
					id : this.examId
				}).then(res => {
					this.examFinishInfo = res;
				})
			}
		}
		
	}
</script>

<style lang="scss" scoped>
.body{
    /*距离顶部范围应该在88-95范围内*/
    padding-top: 90upx;
    top: var(--status-bar-height);
}

	.topbox {
		position: relative;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.topbox::after {
		content: '';
		width: 140%;
		height: 300upx;
		position: absolute;
		left: -20%;
		top: 0;
		z-index: -1;
		border-radius: 0 0 50% 50%;
		background-color: #12B9A3;
	}
		
	.img {
		margin-top: 50upx;
		width: 100upx;
		height: 100upx;
	}
	.topTitle {
	  margin-top: 22upx;
		font-size: 28upx;
		text-align: center;
		color: #ffffff;
	}
	
	.scoreInfo {
		margin: 30upx;
		background-color: #FFFFFF;
		border-radius: 16upx;
		position: relative;
		top: -10upx;
	}
	
		.mitem {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 100upx;
			padding: 0 38upx;
			text {
				font-size: 28upx;
				font-family: Source Han Sans CN, Source Han Sans CN-Regular;
				font-weight: bold;
				text-align: left;
				color: #333333;
			}
		}
	
</style>
